package com.cqndt.disaster.device.dao;

import java.util.Map;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.cqndt.disaster.device.vo.TabProjectVo;
import com.cqndt.disaster.device.domain.TabProject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@Mapper
public interface TabProjectMapper extends BaseMapper<TabProject>{
 
    int deleteByPrimaryKey(Integer id);

    int insert(TabProject record);

    int insertSelective(TabProject record);

    TabProject selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TabProject record);

    int updateByPrimaryKeyWithBLOBs(TabProject record);

    int updateByPrimaryKey(TabProject record);

    /**
     * @param vo
     * @return 根据条件查询项目信息
     **/
    List<TabProjectVo> selectByCondition(TabProjectVo vo);

    /**
     * @param userId
     * @return  查询用户对应的项目数量
     **/
    Integer countProjectNumber(Integer userId);

    /**
     * @param userId
     * @return  获取用户所属项目
     **/
    List<Map<String,Object>> selectByUserId(Integer userId);

    /**
     * @param projectId
     * @return 获取项目所有的设备
     **/
    List<Map<String,Object>> getDeviceByProjectId(@Param("projectId") Integer projectId,@Param("offlineTime")Integer offlineTime);
    /**
     * @param projectId
     * @return 获取项目所有的设备在线离线数量
     **/
    Map<String,Object> getDeviceNumByProjectId(@Param("projectId") Integer projectId,@Param("offlineTime")Integer offlineTime);
}